package com.jvk.check4home.frwk;

import android.os.Parcel;
import android.os.Parcelable;

import com.dreasyLib.dataPattern.DTO;

public class homeDTO implements DTO {

	//name


	public boolean modify=false;

	public int pos=-1;
	//datos del piso
	public String name="";
	public String rooms="";
	public String bathrooms="";
	public String flat_number="";
	public String scuareM="";
	public String elevators="";
	public String parkings="";
	public String commonPlaces="";
	public String r_rooms="";
	public String r_bathrooms="";
	public String r_kitchen="";
	public String r_floor="";
	public String r_outside="";
	public String r_muebles="";
	public String r_doublewindows="";
	public String r_bathroom_Date="";
	public String phone_cable="";
	public String gas_electricity="";
	public String    bus_distance="";
	public String    metro_distance="";
	public String 	  community="";
	public String 	  price="";
	public String comments="";
	public String    personal_score="";
	public String contact_mail="";
	public String web="";
	public String phone="";
	public String call_horary="";
	public String latit="";
	public String longit="";

	@Override
	public int describeContents() {

		return 0;
	}

	// Parcelling part
	public homeDTO(Parcel in){
		String[] data = new String[30];
		in.readStringArray(data);
		this.name = data[0];
		this.rooms=data[1];
		this.bathrooms=data[2];
		this.flat_number=data[3];
		this.scuareM=data[4];
		this.elevators=data[5];
		this.parkings=data[6];
		this.commonPlaces=data[7];
		this.r_rooms=data[8];
		this.r_bathrooms=data[9];
		this.r_kitchen=data[10];
		this.r_floor=data[11];
		this.r_outside=data[12];
		this.r_muebles=data[13];
		this.r_doublewindows=data[14];
		this.r_bathroom_Date=data[15];
		this.phone_cable=data[16];
		this.gas_electricity=data[17];
		this.bus_distance=data[18];
		this.metro_distance=data[19];
		this.community=data[20];
		this.price=data[21];
		this.comments=data[22];
		this.personal_score=data[23];
		this.contact_mail=data[24];
		this.web=data[25];
		this.phone=data[26];
		this.call_horary=data[27];
		this.latit=data[28];
		this.longit=data[29];
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeStringArray(new String[] {
				this.name,
				this.rooms,
				this.bathrooms,
				this.flat_number,
				this.scuareM,
				this.elevators,
				this.parkings,
				this.commonPlaces,
				this.r_rooms,
				this.r_bathrooms,
				this.r_kitchen,
				this.r_floor,
				this.r_outside,
				this.r_muebles,
				this.r_doublewindows,
				this.r_bathroom_Date,
				this.phone_cable,
				this.gas_electricity,
				this.bus_distance,
				this.metro_distance,
				this.community,
				this.price,
				this.comments,
				this.personal_score,
				this.contact_mail,
				this.web,
				this.phone,
				this.call_horary,
				this.latit,
				this.longit});
	}
	public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
		public homeDTO createFromParcel(Parcel in) {
			return new homeDTO(in); 
		}

		public homeDTO[] newArray(int size) {
			return new homeDTO[size];
		}
	};

	public homeDTO()
	{
		name="check4home";
		rooms="";
		bathrooms="0";
		flat_number="0";
		scuareM="0";
		elevators="0";
		parkings="0";
		commonPlaces="0";
		r_rooms="0";
		r_bathrooms="0";
		r_kitchen="0";
		r_floor="0";
		r_outside="0";
		r_muebles="0";
		r_doublewindows="0";
		r_bathroom_Date="0";
		phone_cable="0";
		gas_electricity="0";
		bus_distance="0";
		metro_distance="0";
		community="0";
		price="0";
		comments="0";
		personal_score="0";
		contact_mail="default@mail.com";
		web="www.google.com";
		phone="0";
		call_horary="0";
		latit="0";
		longit="0";		
	}

	public homeDTO(homeDTO localHome) {
		this.name =localHome.name;
		this.rooms=localHome.rooms;
		this.bathrooms=localHome.bathrooms;
		this.flat_number=localHome.flat_number;
		this.scuareM=localHome.scuareM;
		this.elevators=localHome.elevators;
		this.parkings=localHome.parkings;
		this.commonPlaces=localHome.commonPlaces;
		this.r_kitchen=localHome.r_kitchen;
		this.r_floor=localHome.r_floor;
		this.r_outside=localHome.r_outside;
		this.r_muebles=localHome.r_muebles;
		this.r_rooms=localHome.r_rooms;
		this.r_bathrooms=localHome.r_bathrooms;
		this.r_doublewindows=localHome.r_doublewindows;
		this.r_bathroom_Date=localHome.r_bathroom_Date;
		this.phone_cable=localHome.phone_cable;
		this.gas_electricity=localHome.gas_electricity;
		this.bus_distance=localHome.bus_distance;
		this.metro_distance=localHome.metro_distance;
		this.community=localHome.community;
		this.price=localHome.price;
		this.comments=localHome.comments;
		this.personal_score=localHome.personal_score;
		this.contact_mail=localHome.contact_mail;
		this.web=localHome.web;
		this.phone=localHome.phone;
		this.call_horary=localHome.call_horary;
		this.latit=localHome.latit;
		this.longit=localHome.longit;
	}


}
